package controller

import (
	"fiber-demo/internal/common"
	"github.com/gofiber/fiber/v3"
)

type GreeterController struct{}

var GreeterControllerInstance = GreeterController{}

// Hello handler for hello world
// @Description hello world
// @Summary hello world
// @Tags Greeter
// @Accept json
// @Produce json
// @Param name query string false "name"
// @Success 200 {object} map[string]any
// @Router /greeter [get]
func (c GreeterController) Hello(ctx fiber.Ctx) error {
	name := ctx.Query("name", "张三")
	return ctx.JSON(common.NewResponseBuilder().Data(name).Build())
}
